/********************************************************************
FileName    :   Dal_TempStorageB.cs
CreateTime  :   2019-01-17 01:01
BaseClass   :   Dal_TempStorageB
FileType    :   .cs
Author      :  minjie
Description :   Dal_TempStorageBDAL层（简单三层）
*********************************************************************/

using System;
using System.Text;
using System.Data.SqlClient;
using System.Collections.Generic;

using System.Data;
using HT.DBUtility;

namespace HT.DAL
{
	/// <summary>
	/// Dal_TempStorageB的摘要说明。
	/// </summary>
	public partial class Dal_TempStorageB 
  	{ 
     		      
  		public bool Exists() 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("select count(1) from TempStorageB"); 
           SqlParameter[] parameters = { };  
          			return DbHelperSQL.Exists(strSql.ToString(),parameters); 
  		} 
  		 
  				 
  		 
  		/// <summary> 
  		/// 增加一条数据 
  		/// </summary> 
  		public  bool  Add(TempStorageB_Entity model) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("insert into TempStorageB(");			 
  	        strSql.Append("tempDjlsh,hh,spbh,spmc,gg,dw,sl,dj,ssje,zke,zkl,yyymc,bdz,cj,cjhh,jj,gysmc,pfj,zhj,tmh) values ("); 
  	        strSql.Append("	@tempDjlsh,@hh,@spbh,@spmc,@gg,@dw,@sl,@dj,@ssje,@zke,@zkl,@yyymc,@bdz,@cj,@cjhh,@jj,@gysmc,@pfj,@zhj,@tmh	 ) "); 
  			SqlParameter[] parameters = { 
              new SqlParameter("@tempDjlsh", SqlDbType.Int,4) ,              
              new SqlParameter("@hh", SqlDbType.Int,4) ,              
              new SqlParameter("@spbh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@spmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@gg", SqlDbType.VarChar,50) ,              
              new SqlParameter("@dw", SqlDbType.VarChar,50) ,              
              new SqlParameter("@sl", SqlDbType.Int,4) ,              
              new SqlParameter("@dj", SqlDbType.Decimal,9) ,              
              new SqlParameter("@ssje", SqlDbType.Decimal,9) ,              
              new SqlParameter("@zke", SqlDbType.Decimal,9) ,              
              new SqlParameter("@zkl", SqlDbType.Float,8) ,              
              new SqlParameter("@yyymc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@bdz", SqlDbType.Int,4) ,              
              new SqlParameter("@cj", SqlDbType.VarChar,50) ,              
              new SqlParameter("@cjhh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@jj", SqlDbType.Decimal,9) ,              
              new SqlParameter("@gysmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@pfj", SqlDbType.Decimal,9) ,              
              new SqlParameter("@zhj", SqlDbType.Decimal,9) ,              
              new SqlParameter("@tmh", SqlDbType.VarChar,50)};             
              parameters[0].Value = model.tempDjlsh;  
              
              parameters[1].Value = model.hh;  
              
           if (model.spbh != null)  
              parameters[2].Value = model.spbh;  
           else  
              parameters[2].Value = DBNull.Value;  
              
           if (model.spmc != null)  
              parameters[3].Value = model.spmc;  
           else  
              parameters[3].Value = DBNull.Value;  
              
           if (model.gg != null)  
              parameters[4].Value = model.gg;  
           else  
              parameters[4].Value = DBNull.Value;  
              
           if (model.dw != null)  
              parameters[5].Value = model.dw;  
           else  
              parameters[5].Value = DBNull.Value;  
              
              parameters[6].Value = model.sl;  
              
           if (model.dj != null)  
              parameters[7].Value = model.dj;  
           else  
              parameters[7].Value = DBNull.Value;  
              
           if (model.ssje != null)  
              parameters[8].Value = model.ssje;  
           else  
              parameters[8].Value = DBNull.Value;  
              
           if (model.zke != null)  
              parameters[9].Value = model.zke;  
           else  
              parameters[9].Value = DBNull.Value;  
              
           if (model.zkl != null)  
              parameters[10].Value = model.zkl;  
           else  
              parameters[10].Value = DBNull.Value;  
              
           if (model.yyymc != null)  
              parameters[11].Value = model.yyymc;  
           else  
              parameters[11].Value = DBNull.Value;  
              
              parameters[12].Value = model.bdz;  
              
           if (model.cj != null)  
              parameters[13].Value = model.cj;  
           else  
              parameters[13].Value = DBNull.Value;  
              
           if (model.cjhh != null)  
              parameters[14].Value = model.cjhh;  
           else  
              parameters[14].Value = DBNull.Value;  
              
           if (model.jj != null)  
              parameters[15].Value = model.jj;  
           else  
              parameters[15].Value = DBNull.Value;  
              
           if (model.gysmc != null)  
              parameters[16].Value = model.gysmc;  
           else  
              parameters[16].Value = DBNull.Value;  
              
           if (model.pfj != null)  
              parameters[17].Value = model.pfj;  
           else  
              parameters[17].Value = DBNull.Value;  
              
           if (model.zhj != null)  
              parameters[18].Value = model.zhj;  
           else  
              parameters[18].Value = DBNull.Value;  
              
           if (model.tmh != null)  
              parameters[19].Value = model.tmh;  
           else  
              parameters[19].Value = DBNull.Value;  
              
  			int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);			 
  			if (rows > 0) 
  			{ 
  				return true; 
  			} 
  			else 
  			{ 
              return false;; 
           }  
  		} 
  		 
  		/// <summary> 
  		/// 增加一条数据(字符串) 
  		/// </summary> 
  		public  string  AddStr(TempStorageB_Entity model) 
  		{ 
  				if(model.tempDjlsh==null) 
  				{ 
  					model.tempDjlsh=0; 
  				} 
  				if(model.hh==null) 
  				{ 
  					model.hh=0; 
  				} 
  				if(model.spbh==null) 
  				{ 
  					model.spbh="";  
  				} 
  				if(model.spmc==null) 
  				{ 
  					model.spmc="";  
  				} 
  				if(model.gg==null) 
  				{ 
  					model.gg="";  
  				} 
  				if(model.dw==null) 
  				{ 
  					model.dw="";  
  				} 
  				if(model.sl==null) 
  				{ 
  					model.sl=0; 
  				} 
  				if(model.dj==null) 
  				{ 
  					model.dj=0; 
  				} 
  				if(model.ssje==null) 
  				{ 
  					model.ssje=0; 
  				} 
  				if(model.zke==null) 
  				{ 
  					model.zke=0; 
  				} 
  				if(model.zkl==null) 
  				{ 
  					model.zkl=0; 
  				} 
  				if(model.yyymc==null) 
  				{ 
  					model.yyymc="";  
  				} 
  				if(model.bdz==null) 
  				{ 
  					model.bdz=0; 
  				} 
  				if(model.cj==null) 
  				{ 
  					model.cj="";  
  				} 
  				if(model.cjhh==null) 
  				{ 
  					model.cjhh="";  
  				} 
  				if(model.jj==null) 
  				{ 
  					model.jj=0; 
  				} 
  				if(model.gysmc==null) 
  				{ 
  					model.gysmc="";  
  				} 
  				if(model.pfj==null) 
  				{ 
  					model.pfj=0; 
  				} 
  				if(model.zhj==null) 
  				{ 
  					model.zhj=0; 
  				} 
  				if(model.tmh==null) 
  				{ 
  					model.tmh="";  
  				} 
  		 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("insert into TempStorageB(");			 
  	        strSql.Append("tempDjlsh,hh,spbh,spmc,gg,dw,sl,dj,ssje,zke,zkl,yyymc,bdz,cj,cjhh,jj,gysmc,pfj,zhj,tmh) values ("); 
  	        strSql.Append("	"+ model.tempDjlsh+","+ model.hh+",'"+ model.spbh+"','"+ model.spmc+"','"+ model.gg+"','"+ model.dw+"',"+ model.sl+","+ model.dj+","+ model.ssje+","+ model.zke+","+ model.zkl+",'"+ model.yyymc+"',"+ model.bdz+",'"+ model.cj+"','"+ model.cjhh+"',"+ model.jj+",'"+ model.gysmc+"',"+ model.pfj+","+ model.zhj+",'" +model.tmh+"'	 ) "); 
           return strSql.ToString(); 
  		} 
  		 
  		 
  		/// <summary> 
  		/// 更新一条数据 
  		/// </summary> 
  		public bool Update(TempStorageB_Entity model) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("update TempStorageB set "); 
                      strSql.Append(" tempDjlsh = @tempDjlsh,"); 
              strSql.Append(" hh = @hh,"); 
              strSql.Append(" spbh = @spbh,"); 
              strSql.Append(" spmc = @spmc,"); 
              strSql.Append(" gg = @gg,"); 
              strSql.Append(" dw = @dw,"); 
              strSql.Append(" sl = @sl,"); 
              strSql.Append(" dj = @dj,"); 
              strSql.Append(" ssje = @ssje,"); 
              strSql.Append(" zke = @zke,"); 
              strSql.Append(" zkl = @zkl,"); 
              strSql.Append(" yyymc = @yyymc,"); 
              strSql.Append(" bdz = @bdz,"); 
              strSql.Append(" cj = @cj,"); 
              strSql.Append(" cjhh = @cjhh,"); 
              strSql.Append(" jj = @jj,"); 
              strSql.Append(" gysmc = @gysmc,"); 
              strSql.Append(" pfj = @pfj,"); 
              strSql.Append(" zhj = @zhj,"); 
              strSql.Append(" tmh = @tmh"); 
  			strSql.Append(" where   "); 
  						 
           SqlParameter[] parameters = { 
                      new SqlParameter("@tempDjlsh", SqlDbType.Int,4) ,              
              new SqlParameter("@hh", SqlDbType.Int,4) ,              
              new SqlParameter("@spbh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@spmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@gg", SqlDbType.VarChar,50) ,              
              new SqlParameter("@dw", SqlDbType.VarChar,50) ,              
              new SqlParameter("@sl", SqlDbType.Int,4) ,              
              new SqlParameter("@dj", SqlDbType.Decimal,9) ,              
              new SqlParameter("@ssje", SqlDbType.Decimal,9) ,              
              new SqlParameter("@zke", SqlDbType.Decimal,9) ,              
              new SqlParameter("@zkl", SqlDbType.Float,8) ,              
              new SqlParameter("@yyymc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@bdz", SqlDbType.Int,4) ,              
              new SqlParameter("@cj", SqlDbType.VarChar,50) ,              
              new SqlParameter("@cjhh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@jj", SqlDbType.Decimal,9) ,              
              new SqlParameter("@gysmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@pfj", SqlDbType.Decimal,9) ,              
              new SqlParameter("@zhj", SqlDbType.Decimal,9) ,              
              new SqlParameter("@tmh", SqlDbType.VarChar,50)};             
                   if (model.tempDjlsh != null)  
              parameters[0].Value = model.tempDjlsh;  
           else  
              parameters[0].Value = DBNull.Value;  
              
           if (model.hh != null)  
              parameters[1].Value = model.hh;  
           else  
              parameters[1].Value = DBNull.Value;  
              
           if (model.spbh != null)  
              parameters[2].Value = model.spbh;  
           else  
              parameters[2].Value = DBNull.Value;  
              
           if (model.spmc != null)  
              parameters[3].Value = model.spmc;  
           else  
              parameters[3].Value = DBNull.Value;  
              
           if (model.gg != null)  
              parameters[4].Value = model.gg;  
           else  
              parameters[4].Value = DBNull.Value;  
              
           if (model.dw != null)  
              parameters[5].Value = model.dw;  
           else  
              parameters[5].Value = DBNull.Value;  
              
           if (model.sl != null)  
              parameters[6].Value = model.sl;  
           else  
              parameters[6].Value = DBNull.Value;  
              
           if (model.dj != null)  
              parameters[7].Value = model.dj;  
           else  
              parameters[7].Value = DBNull.Value;  
              
           if (model.ssje != null)  
              parameters[8].Value = model.ssje;  
           else  
              parameters[8].Value = DBNull.Value;  
              
           if (model.zke != null)  
              parameters[9].Value = model.zke;  
           else  
              parameters[9].Value = DBNull.Value;  
              
           if (model.zkl != null)  
              parameters[10].Value = model.zkl;  
           else  
              parameters[10].Value = DBNull.Value;  
              
           if (model.yyymc != null)  
              parameters[11].Value = model.yyymc;  
           else  
              parameters[11].Value = DBNull.Value;  
              
           if (model.bdz != null)  
              parameters[12].Value = model.bdz;  
           else  
              parameters[12].Value = DBNull.Value;  
              
           if (model.cj != null)  
              parameters[13].Value = model.cj;  
           else  
              parameters[13].Value = DBNull.Value;  
              
           if (model.cjhh != null)  
              parameters[14].Value = model.cjhh;  
           else  
              parameters[14].Value = DBNull.Value;  
              
           if (model.jj != null)  
              parameters[15].Value = model.jj;  
           else  
              parameters[15].Value = DBNull.Value;  
              
           if (model.gysmc != null)  
              parameters[16].Value = model.gysmc;  
           else  
              parameters[16].Value = DBNull.Value;  
              
           if (model.pfj != null)  
              parameters[17].Value = model.pfj;  
           else  
              parameters[17].Value = DBNull.Value;  
              
           if (model.zhj != null)  
              parameters[18].Value = model.zhj;  
           else  
              parameters[18].Value = DBNull.Value;  
              
           if (model.tmh != null)  
              parameters[19].Value = model.tmh;  
           else  
              parameters[19].Value = DBNull.Value;  
              
           int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); 
  			if (rows > 0) 
  			{ 
  				return true; 
  			} 
  			else 
  			{ 
  				return false; 
  			} 
  		} 
  		 
  		 
  		/// <summary> 
  		/// 更新一条数据(字符串) 2016-07-13更新 
  		///   2017-03-23更新 minjie 
  		/// </summary> 
  		public  string  UpdateStr(TempStorageB_Entity model) 
  		{ 
  				if(model.tempDjlsh==null) 
  				{ 
  					model.tempDjlsh=0; 
  				} 
  				if(model.hh==null) 
  				{ 
  					model.hh=0; 
  				} 
  				if(model.spbh==null) 
  				{ 
  					model.spbh="";  
  				} 
  				if(model.spmc==null) 
  				{ 
  					model.spmc="";  
  				} 
  				if(model.gg==null) 
  				{ 
  					model.gg="";  
  				} 
  				if(model.dw==null) 
  				{ 
  					model.dw="";  
  				} 
  				if(model.sl==null) 
  				{ 
  					model.sl=0; 
  				} 
  				if(model.dj==null) 
  				{ 
  					model.dj=0; 
  				} 
  				if(model.ssje==null) 
  				{ 
  					model.ssje=0; 
  				} 
  				if(model.zke==null) 
  				{ 
  					model.zke=0; 
  				} 
  				if(model.zkl==null) 
  				{ 
  					model.zkl=0; 
  				} 
  				if(model.yyymc==null) 
  				{ 
  					model.yyymc="";  
  				} 
  				if(model.bdz==null) 
  				{ 
  					model.bdz=0; 
  				} 
  				if(model.cj==null) 
  				{ 
  					model.cj="";  
  				} 
  				if(model.cjhh==null) 
  				{ 
  					model.cjhh="";  
  				} 
  				if(model.jj==null) 
  				{ 
  					model.jj=0; 
  				} 
  				if(model.gysmc==null) 
  				{ 
  					model.gysmc="";  
  				} 
  				if(model.pfj==null) 
  				{ 
  					model.pfj=0; 
  				} 
  				if(model.zhj==null) 
  				{ 
  					model.zhj=0; 
  				} 
  				if(model.tmh==null) 
  				{ 
  					model.tmh="";  
  				} 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("update TempStorageB set "); 
              strSql.Append(" tempDjlsh = "+model.tempDjlsh+","); 
              strSql.Append(" hh = "+model.hh+","); 
              strSql.Append(" spbh ='"+ model.spbh+"',"); 
              strSql.Append(" spmc ='"+ model.spmc+"',"); 
              strSql.Append(" gg ='"+ model.gg+"',"); 
              strSql.Append(" dw ='"+ model.dw+"',"); 
              strSql.Append(" sl = "+model.sl+","); 
              strSql.Append(" dj = "+model.dj+","); 
              strSql.Append(" ssje = "+model.ssje+","); 
              strSql.Append(" zke = "+model.zke+","); 
              strSql.Append(" zkl = "+model.zkl+","); 
              strSql.Append(" yyymc ='"+ model.yyymc+"',"); 
              strSql.Append(" bdz = "+model.bdz+","); 
              strSql.Append(" cj ='"+ model.cj+"',"); 
              strSql.Append(" cjhh ='"+ model.cjhh+"',"); 
              strSql.Append(" jj = "+model.jj+","); 
              strSql.Append(" gysmc ='"+ model.gysmc+"',"); 
              strSql.Append(" pfj = "+model.pfj+","); 
              strSql.Append(" zhj = "+model.zhj+","); 
              strSql.Append(" tmh = '"+model.tmh+"'"); 
  			strSql.Append(" where   "); 
  						 
           return strSql.ToString(); 
  		} 
  		 
  		 
  		/// <summary> 
  		/// 删除一条数据 
  		/// </summary> 
  		public bool Delete() 
  		{ 
  			 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("delete from TempStorageB "); 
  			strSql.Append(" where  "); 
           SqlParameter[] parameters = { };  
  			 
   
  			int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); 
  			if (rows > 0) 
  			{ 
  				return true; 
  			} 
  			else 
  			{ 
  				return false; 
  			} 
  		} 
  		 
  		/// <summary> 
  		/// 批量删除一批数据 
  		/// </summary> 
  		public bool DeleteList(string lists ) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("delete from TempStorageB "); 
  			strSql.Append(" where ID in ("+ lists + ")  "); 
  			int rows=DbHelperSQL.ExecuteSql(strSql.ToString()); 
  			if (rows > 0) 
  			{ 
  				return true; 
  			} 
  			else 
  			{ 
  				return false; 
  			} 
  		} 
  		 
  		 
  		/// <summary> 
  		/// 得到一个对象实体 
  		/// </summary> 
  		public TempStorageB_Entity GetModel() 
  		{ 
  			 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("select  tempDjlsh,hh,spbh,spmc,gg,dw,sl,dj,ssje,zke,zkl,yyymc,bdz,cj,cjhh,jj,gysmc,pfj,zhj,tmh");			 
  	        strSql.Append("  from TempStorageB"); 
  			strSql.Append(" where   "); 
           SqlParameter[] parameters = { };  
  			 
  			 
  			TempStorageB_Entity model=new TempStorageB_Entity(); 
  			DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters); 
  		        DataTable dt=ds.Tables[0];	  
  				return DataTableToEntity(dt); 
  		} 
  		 
  		 
  		 
  		 
  		/// <summary> 
  		/// 将数据集(DataTable)转换 对象 TempStorageB_Entity
  		/// 创建人：minjie 
  		/// 创建时间:2019-01-17 01:45:08 
  		/// </summary> 
  		public TempStorageB_Entity DataTableToEntity(DataTable dt) 
  		{ 
  			TempStorageB_Entity model=new TempStorageB_Entity(); 
  			 
  			if(dt!=null&&dt.Rows.Count>0) 
  			{ 
  				if(dt.Rows[0]["tempDjlsh"]!=null&&dt.Rows[0]["tempDjlsh"].ToString()!="") 
  				{ 
  					model.tempDjlsh=int.Parse(dt.Rows[0]["tempDjlsh"].ToString()); 
  				} 
  				if(dt.Rows[0]["hh"]!=null&&dt.Rows[0]["hh"].ToString()!="") 
  				{ 
  					model.hh=int.Parse(dt.Rows[0]["hh"].ToString()); 
  				} 
  				model.spbh= dt.Rows[0]["spbh"].ToString(); 
  				model.spmc= dt.Rows[0]["spmc"].ToString(); 
  				model.gg= dt.Rows[0]["gg"].ToString(); 
  				model.dw= dt.Rows[0]["dw"].ToString(); 
  				if(dt.Rows[0]["sl"]!=null&&dt.Rows[0]["sl"].ToString()!="") 
  				{ 
  					model.sl=int.Parse(dt.Rows[0]["sl"].ToString()); 
  				} 
  				if(dt.Rows[0]["dj"]!=null&&dt.Rows[0]["dj"].ToString()!="") 
  				{ 
  					model.dj=decimal.Parse(dt.Rows[0]["dj"].ToString()); 
  				} 
  				if(dt.Rows[0]["ssje"]!=null&&dt.Rows[0]["ssje"].ToString()!="") 
  				{ 
  					model.ssje=decimal.Parse(dt.Rows[0]["ssje"].ToString()); 
  				} 
  				if(dt.Rows[0]["zke"]!=null&&dt.Rows[0]["zke"].ToString()!="") 
  				{ 
  					model.zke=decimal.Parse(dt.Rows[0]["zke"].ToString()); 
  				} 
  				if(dt.Rows[0]["zkl"]!=null&&dt.Rows[0]["zkl"].ToString()!="") 
  				{ 
  					model.zkl=decimal.Parse(dt.Rows[0]["zkl"].ToString()); 
  				} 
  				model.yyymc= dt.Rows[0]["yyymc"].ToString(); 
  				if(dt.Rows[0]["bdz"]!=null&&dt.Rows[0]["bdz"].ToString()!="") 
  				{ 
  					model.bdz=int.Parse(dt.Rows[0]["bdz"].ToString()); 
  				} 
  				model.cj= dt.Rows[0]["cj"].ToString(); 
  				model.cjhh= dt.Rows[0]["cjhh"].ToString(); 
  				if(dt.Rows[0]["jj"]!=null&&dt.Rows[0]["jj"].ToString()!="") 
  				{ 
  					model.jj=decimal.Parse(dt.Rows[0]["jj"].ToString()); 
  				} 
  				model.gysmc= dt.Rows[0]["gysmc"].ToString(); 
  				if(dt.Rows[0]["pfj"]!=null&&dt.Rows[0]["pfj"].ToString()!="") 
  				{ 
  					model.pfj=decimal.Parse(dt.Rows[0]["pfj"].ToString()); 
  				} 
  				if(dt.Rows[0]["zhj"]!=null&&dt.Rows[0]["zhj"].ToString()!="") 
  				{ 
  					model.zhj=decimal.Parse(dt.Rows[0]["zhj"].ToString()); 
  				} 
  				model.tmh= dt.Rows[0]["tmh"].ToString(); 
  				return model; 
  			} 
  			else 
  			{ 
  				return null; 
  			} 
  		} 
  		 
  		/// <summary> 
  		/// 分页获取数据列表 
  		/// </summary> 
  		public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  		 strSql.Append("SELECT * FROM ( "); 
  		 strSql.Append(" SELECT ROW_NUMBER() OVER ("); 
  if (!string.IsNullOrEmpty(orderby.Trim())) 
 { 
    strSql.Append("order by " ); 
 } 
else  
 { 
     strSql.Append("order by  desc"); 
 } 
		 strSql.Append(")AS Row, T.*  from TempStorageB T "); 
  		 if (!string.IsNullOrEmpty(strWhere.Trim()))  
  			{ 
  			 strSql.Append(" WHERE " + strWhere); 
  			} 
  		    strSql.Append(" ) TT"); 
  	        strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);			return DbHelperSQL.Query(strSql.ToString()); 
  		} 
  		 
  		 
  		/// <summary> 
  		/// 获得数据列表 
  		/// </summary> 
  		public DataSet GetList(string strWhere) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("select * "); 
  			strSql.Append(" FROM TempStorageB "); 
  			if(strWhere.Trim()!="") 
  			{ 
  				strSql.Append(" where "+strWhere); 
  			} 
  			return DbHelperSQL.Query(strSql.ToString()); 
  		} 
  		 
  		/// <summary> 
  		/// 获得前几行数据 
  		/// </summary> 
  		public DataSet GetList(int Top,string strWhere,string filedOrder) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("select "); 
  			if(Top>0) 
  			{ 
  				strSql.Append(" top "+Top.ToString()); 
  			} 
  			strSql.Append(" * "); 
  			strSql.Append(" FROM TempStorageB "); 
  			if(strWhere.Trim()!="") 
  			{ 
  				strSql.Append(" where "+strWhere); 
  			} 
  			strSql.Append(" order by " + filedOrder); 
  			return DbHelperSQL.Query(strSql.ToString()); 
  		} 
  		/// <summary> 
  		/// 批量处理  
  		/// </summary> 
  		public int ExecuteSqlTran(List<string> ls,ref string error) 
  		{ 
  			return DbHelperSQL.ExecuteSqlTran(ls,ref   error); 
  		} 
  		 
  		/// <summary> 
  		/// 执行sql语句  
  		/// </summary> 
  		public int ExecuteSql(string sql) 
  		{ 
  			return DbHelperSQL.ExecuteSql(sql); 
  		} 
  		 
  		/// <summary> 
  		/// 执行sql语句  
  		/// </summary> 
  		public string GetSingle(string sql) 
  		{ 
  			object obj= DbHelperSQL.GetSingle(sql); 
  			 if (obj != null) 
  			 { 
  			    return obj.ToString(); 
  		     } 
  		     else 
  		        return ""; 
  		} 
  		 
  		/// <summary> 
  		/// 执行sql语句  
  		/// </summary> 
  		public DataTable  ExecuteDt(string sql) 
  		{ 
  			return DbHelperSQL.ExecuteDt(sql); 
  		} 
  		 
  		 
  		/// <summary> 
  		/// 获得记录条数 
  		/// </summary> 
  		public int GetRecordCount(string strWhere) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("select count(1) "); 
  			strSql.Append(" FROM TempStorageB "); 
  			if(strWhere.Trim()!="") 
  			{ 
  				strSql.Append(" where "+strWhere); 
  			} 
  		   object obj=	DbHelperSQL.GetSingle(strSql.ToString()); 
  			if(obj!=null && obj.ToString()!="") 
  			{ 
              	return Convert.ToInt32(obj); 
  			} 
  			else 
  			return 0; 
  		} 
   
      
  	} 
  
}
